<html>
	<meta charset="utf-8" />
	<title>Api Client - Request</title>
	<script src="js-lib/jquery-1.8.0.js"></script>
	<script src="js-lib/util.js"></script>
	
	<script src="js/model.js"></script>
	<script src="js/controller.js"></script>
	<script src="js/view.js"></script>
	
	<script type="text/javascript">
		function main(){
			var config = <%= request.getParameter("_config") %>;
			
			var loginController = new LoginController(config);
			var requestController = new RequestController(loginController);
		};
	</script>
	
	<body onload='main()'>
		<h2>Api client<span id="versionDiv" style="font-size: 10pt"> </span></h2>
<!--    <a href="/api-web/update.htm" target="_blank" style="font-size: 12pt; position: absolute; top:0px; right:0px;">Update api version</a> -->
		<div id="environmentDiv">
			<select id='scheme'>
				<option value="https">https</option>
				<option value="http">http</option>
			</select>
			<label>://</label> <input type="text" placeholder="Host" id="environmentField" size="30" style='position: absolute;'/>   
			<select id='environmentSelect'></select>
			<label>/</label>
			<input type="text" id="servicePath" value="api" size="16" style='position: absolute;'/>
			<select id='servicePathSelect'>
				<option value="api">api</option>
				<option value="wallservice">wallservice</option>
				<option value="userservice">userservice</option>
				<option value="syncronizationservice">syncronizationservice</option>
				<option value="invitationservice">invitationservice</option>
			</select>
			<br/>
			<br/>
			Consumer keys: [<input type="text" id="consumerKey" size="40"/>, <input type="text" id="consumerSecret" size="40"/>]
			<form id="login">
				<div id="columnDiv" style='position: absolute; top: 30px; right: 20px;'>
					<label>Token service: /</label><input type="text" value="tokenservice" id="tokenServiceField"/>
					<a id="newRequestLink" href="#" style="position: absolute; font-size: 10pt; right: 5px;">New request</a>   
					<br/>
					<br/>
					<label>Request service: /</label><input type="text" id="requestServiceField" value="oauth/v1/get_request_token" size="50" />
					<br/>
					<label>Authorization service: /</label><input type="text" id="authorizationServiceField" value="oauth/v1/NoBrowserAuthorization" size="50"/>
					<br/>
					<label>Access service: /</label><input type="text" id="accessServiceField" value="oauth/v1/get_access_token" size="50"/>
					<br/>
					<br/>
					Username : 
					<input type="text" name="user" id="user"/>  Password : 
					<input type="password" name="password" id="password"/>
					<input type="submit" value='Login' id="loginSubmit"/>
					<br/>
				</div> <!-- columnDiv -->
				Access keys: [<input type="text" id="accessKey" size="40"/>, <input type="text" id="accessSecret" size="40"/>]
			</form>
		</div> <!-- environmentDiv -->
		<form id="loggedIn" method="post" action="index.jsp" target="_blank"><input name="_config" type="hidden" /></form>
		<br/>
		<div id="apiService">
			<select id='api' style="font-size: 11pt">
				<option value="0">Select api</option>
			</select>
			Service filter:<input type="text" id="serviceFilter"/> Total: <label id="servicesCount"></label>
			<br>
			<select id='service' style="font-size: 11pt">
				<option value="0">Select api service</option>
			</select>
		</div>
		<br>
		<form id="request" method="POST" target="_blank">
			<label></label> <a href="" id="javadocLink" target="_blank">javadoc</a>
			<br>
			<br>
			<table id="fields"></table>
			<br>
			<input type="hidden" />
			<input type="checkbox" id="iterationCheck"/>Iterative: <input type="text" id="iterationFrom" value='0' size="1"/> to <input type="text" id="iterationTo" value='1' size="1"/>    
			<input type="submit" value='Send Request' />
		</form>
	</body>
</html>
